<template>
	<view class="aboutUs">
		<u-tabs :list="list" :is-scroll="false" active-color="#D1AA56" :current="current" @change="change"></u-tabs>

		<scroll-view scroll-y="true" class="box">
			<u-parse :html="content"></u-parse>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: '公司简介'
				}, {
					name: '公司创始人'
				}, {
					name: '公司证书'
				}],
				current: 0,
				content:'',
				aboutUsHtml: '',
				htmlTwo: '',
				htmlThree: ''
			};
		},
		created() {
			this.getAboutUs()
		},
		methods: {
			change(index) {
				this.current = index
				console.log(index)
				if(index == 0){
					this.content = this.aboutUsHtml
				}else if(index == 1){
					this.content = this.htmlTwo
				}else{
					this.content = this.htmlThree
				}
			},
			getAboutUs() {
				uni.request({
					url: this.$Url + '/index.php/App/User/systemArticle',
					method: 'POST',
					data: {

					},
					header: {
						"token": uni.getStorageSync('token')
					},
					success: (res) => {
						let htmlTxt = res.data.data[0].content.replace(/\<img/gi, '<img style="width:100%;height:auto"')
						let htmlTxtTwo = res.data.data[1].content.replace(/\<img/gi, '<img style="width:100%;height:auto"')
						let htmlTxtThree = res.data.data[2].content.replace(/\<img/gi, '<img style="width:100%;height:auto"')
						this.aboutUsHtml = htmlTxt
						this.htmlTwo = htmlTxtTwo
						this.htmlThree = htmlTxtThree
						this.content = this.aboutUsHtml
					}
				})
			}
		}
	}
</script>
<style scoped lang="scss">
	.aboutUs {
		width: 100vw;

		.box {
			padding: 0 30upx;
			width: calc(100vw - 60upx);
			height: calc(100vh - 100upx);
		}
	}
</style>
